/*
 * @(#)MockMyUccBO.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.service.mock;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Web Platform Development Team
 */
public class MockMyUccBO {
	Log log = LogFactory.getLog(MockMyUccBO.class);
	@SuppressWarnings("unchecked")
	public Map getUser(Map parameterMap) {
		log.debug("Project Name : " + parameterMap.get("project"));
		Map result = new HashMap();
		if (!(parameterMap.containsKey("project") || 
				parameterMap.get("project").equals("SPS"))) {
			return null;
		}
		
		System.out.println("aaaaaaaaaaa");
		//Testcase에서 Control블럭외에서 처리되야할 값(pageInfo)이 존재해서는 안됨을 테스트 
		if (parameterMap.get("pageInfo") == null) {
			result.put("id", "answer");
			result.put("flag", 2);
		}
		System.out.println("bbbbbbbbbbb");
		return result;
	}
	
	@SuppressWarnings("unchecked")
	public Map getName(String userId, int flag) {
		Map result = new HashMap();
		if (userId.equals("answer") && flag == 2) {
			result.put("lastname", "송");
			result.put("firstname", "창근");
		}
		return result;
	}
	
	@SuppressWarnings("unchecked")
	public Map getNick(String lastname, int flag) {
		Map result = new HashMap();
		if (lastname.equals("송") && flag == 2) {
			result.put("nickname", "송창식");
		}
		return result;
	}

    @SuppressWarnings("unchecked")
	public Map invokeException() throws Exception{
		throw new Exception("UCC_EXCEPTION");
	}
}
